<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Easy
  </div>
  <div>
   <h1 class="question_title">
    69. Sqrt(x)
   </h1>
   <p>
    Implement
    <code>
     int sqrt(int x)
    </code>
    .
   </p>
   <p>
    Compute and return the square root of
    <em>
     x
    </em>
    , where&nbsp;
    <em>
     x
    </em>
    &nbsp;is guaranteed to be a non-negative integer.
   </p>
   <p>
    Since the return type&nbsp;is an integer, the decimal digits are truncated and only the integer part of the result&nbsp;is returned.
   </p>
   <p>
    <strong>
     Example 1:
    </strong>
   </p>
   <pre>
<strong>Input:</strong> 4
<strong>Output:</strong> 2
</pre>
   <p>
    <strong>
     Example 2:
    </strong>
   </p>
   <pre>
<strong>Input:</strong> 8
<strong>Output:</strong> 2
<strong>Explanation:</strong> The square root of 8 is 2.82842..., and since 
&nbsp;            the decimal part is truncated, 2 is returned.
</pre>
  </div>
  <div>
   <h1 class="question_title">
    69. x 的平方根
   </h1>
   <p>
    实现&nbsp;
    <code>
     int sqrt(int x)
    </code>
    &nbsp;函数。
   </p>
   <p>
    计算并返回&nbsp;
    <em>
     x
    </em>
    &nbsp;的平方根，其中&nbsp;
    <em>
     x
    </em>
    是非负整数。
   </p>
   <p>
    由于返回类型是整数，结果只保留整数的部分，小数部分将被舍去。
   </p>
   <p>
    <strong>
     示例 1:
    </strong>
   </p>
   <pre><strong>输入:</strong> 4
<strong>输出:</strong> 2
</pre>
   <p>
    <strong>
     示例 2:
    </strong>
   </p>
   <pre><strong>输入:</strong> 8
<strong>输出:</strong> 2
<strong>说明:</strong> 8 的平方根是 2.82842..., 
&nbsp;    由于返回类型是整数，小数部分将被舍去。
</pre>
  </div>
 </body>
</html>